Ext.define('wmf.model.product.product', {
    extend: 'Ext.data.Model',
    fields: [
        { name: 'id', type: 'string' },
        { name: 'productName', type: 'string' },
        { name: 'productNameOrId', type: 'string' ,convert: function(v, record){
			return record.data.id;
        }},
        { name: 'name', type: 'string' ,convert: function(v, record){
			return record.data.productName + '[' + record.data.id + ']';
        }},
        { name: 'ecNameOrId', type: 'string' ,convert: function(v, record){
			return record.data.ecName + '[' + record.data.ecId + ']';
        }},
        { name: 'ecId', type: 'string' },
        { name: 'ecName', type: 'string' },
        { name: 'serviceType', type: 'string' },
        { name: 'serviceType1', type: 'string' ,convert: function(v, record){
			var value = record.data.serviceType;
			if(value == "1"){
				return "三网";
			}else if(value == "2"){
				return "移动";
			}else if(value == "3"){
				return "联通";
			}else if(value == "4"){
				return "电信";
			}else if(value == "5"){
				return "联通、电信";
			}else if(value == "6"){
				return "移动、联通";
			}else if(value == "7"){
				return "移动、电信";
			}else{
				return value;
			}
        }},
        { name: 'businessType', type: 'string' },
        { name: 'businessType1', type: 'string' ,convert: function(v, record){
			var value = record.data.businessType;
			if(value == "1"){
				return "彩信";
			}else if(value == "2"){
				return "短信";
			}else{
				return value;
			}
        }},
        { name: 'cmccChannelId', type: 'string' },
        { name: 'cmccChannelName', type: 'string' },
        { name: 'cmccChannelSrcid', type: 'string' },
        { name: 'cmccChannelExtParams', type: 'string' },
		{ name: 'unicomChannelId', type: 'string' },
		{ name: 'unicomChannelName', type: 'string' },
		{ name: 'unicomChannelSrcid', type: 'string' },
		{ name: 'unicomChannelExtParams', type: 'string' },
		{ name: 'telcomChannelId', type: 'string' },
		{ name: 'telcomChannelName', type: 'string' },
		{ name: 'telcomChannelSrcid', type: 'string' },
		{ name: 'telcomChannelExtParams', type: 'string' },
		{ name: 'channelName', type: 'string' ,convert: function(v, record){
			var value = '';
			if(record.data.cmccChannelName)
				value += record.data.cmccChannelName + ',';
			if(record.data.unicomChannelName)
				value += record.data.unicomChannelName + ',';
			if(record.data.telcomChannelName)
				value += record.data.telcomChannelName + ',';
			if(value){
				value = value.substring(0, value.length-1);
			}
			return value;
        }},
		{ name: 'priority', type: 'string' },
		{ name: 'priority1', type: 'string' ,convert: function(v, record){
			var value = record.data.priority;
			if(value == "2"){
				return "低";
			}else if(value == "5"){
				return "中";
			}else if(value == "8"){
				return "高";
			}else{
				return value;
			}
        }},
		{ name: 'needAudit', type: 'string' },
		{ name: 'needAudit1', type: 'string' ,convert: function(v, record){
			var value = record.data.needAudit;
			if(value == "0"){
				return "否";
			}else if(value == "1"){
				return "是";
			}else{
				return value;
			}
        }},
		{ name: 'status', type: 'string' },
		{ name: 'status1', type: 'string'  ,convert: function(v, record){
			var value = record.data.status;
			if(value == "0"){
				return "已下线";
			}else if(value == "1"){
				return "在线";
			}else{
				return value;
			}
        }},
		{ name: 'latestOperator', type: 'string' },
		{ name: 'latestOperateTime1', type: 'string' ,convert: function(v, record){
			return wmf.data.mydateformat(record.data.latestOperateTime);
        }},
		{ name: 'latestOperateTime', type: 'string' }
    ]
});